<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>jsmath</title>
    </head>
    <body>
        <script language="javascript" type="text/javascript">
            // 四舍五入
            document.write( Math.round( 0.60 ) + "<br />" );
            document.write( Math.round( 0.50 ) + "<br />" );
            document.write( Math.round( 0.49 ) + "<br />" );
            document.write( Math.round( -4.40 ) + "<br />" );
            document.write( Math.round( -4.60 ) + "<br />" );
            // 随机数
            document.write( Math.random() );
            document.write( "<br />" );
            // 下舍
            document.write( Math.floor( Math.random()*10) );
            document.write( "<br />" );
            // 最大值，最小值
            document.write( Math.max( 4,10,22 ) );
            document.write( "<br />" );
            document.write( Math.min( 4,10,22 ) );
        </script>
        
    </body>
</html>
